import os
from fastapi import APIRouter, Security
from server.util import return_code
from server.response import RespBody
from server.database import db_manager

router = APIRouter(prefix='/setting', tags=['全局设置'])


@router.get('/all', response_model=RespBody[dict], summary='获取全局设置')
async def get_setting():
    setting = await db_manager.fetch_all("SELECT * FROM setting")
    return return_code(200, data=setting)


